package com.springboot.shanhexin.service;

import com.springboot.shanhexin.dao.scenic_spotDao;
import com.springboot.shanhexin.entity.scenic_spot;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class scenic_spotService {

    @Autowired
    private scenic_spotDao scenic_spotDao;

    /**
     * 显示总数量
     * @return
     */
    public int getCount() {
        return scenic_spotDao.getCount();
    }

    /**
     * 全部分页显示
     * @return
     */
    public List<scenic_spot> findByPage(int pos, int size) {
        return scenic_spotDao.findByPage(pos, size);
    }

    /**
     * 显示搜索的总数量
     * @return
     */
    public int getsearchCount(String name) {
        return scenic_spotDao.getsearchCount(name);
    }

    /**
     * 搜索并分页显示
     * @return
     */
    public List<scenic_spot> findsearchByPage(String name,int pos, int size) {
        return scenic_spotDao.findsearchByPage(name,pos, size);
    }

    /**
     * 添加
     * @param
     */
    public void add(scenic_spot scenic_spot) {
        scenic_spotDao.add(scenic_spot);
    }

    /**
     * 删除
     * @param id
     */
    public void delete(int id) {
        scenic_spotDao.delete(id);
    }

    /**
     * 修改(先找到并显示，再修改)
     * @param
     */
    public List<scenic_spot> getUserone(int id) {
        return scenic_spotDao.getUserone(id);
    }
    public void update(scenic_spot scenic_spot) {
        scenic_spotDao.update(scenic_spot);
    }

}
